package com.gerry.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/example")
public class ExampleController {

    @RequestMapping(method = RequestMethod.GET)
    public ModelAndView sayHello(@RequestParam String name) {
        ModelAndView modelAndView = new ModelAndView("helloView");
        modelAndView.addObject("message", "heello " + name );
        return modelAndView ;
    }
}
